const { app, BrowserWindow, dialog } = require('electron');
const isDev = require('electron-is-dev');

let mainWindow;

app.on('ready', () => {
	mainWindow = new BrowserWindow({
		width: 1000,
		height: 600,
		minWidth: 600,
		webPreferences: {
			nodeIntegration: true,
			contextIsolation: false,
		}
	});

	const urlLocation = isDev ? 'http://localhost:3000' : 'pro';

	mainWindow.loadURL(urlLocation);
	console.log('12333');
	dialog.showMessageBox({
		message: 'hello dear, 恭喜启动成功',
		buttons: [ '好说好说' ]
	});
});
